<template>
  <div class="boy">
    <h3>男人组件</h3>
    <div>金钱：{{ money }}</div>
    <!-- <button @click="fn">搬砖+1</button>
    <button @click="fns">卖肾+1000</button>
    <button @click="fnss">卖车+1000</button> -->
    <button @click="zen">搬砖+1</button>
    <button @click="zens(1000)">卖肾+1000</button>
    <button @click="zenss({ var: 1000, key: '雅迪' })">卖车+1000</button>
  </div>
</template>

<script>
import { mapMutations, mapState } from "vuex";
export default {
  methods: {
    // fn() {
    //   this.$store.commit("zen");
    // },
    // fns() {
    //   this.$store.commit("zens", 1000);
    // },
    // fnss() {
    //   this.$store.commit("zenss", {
    //     var: 1000,
    //     key: "雅迪",
    //   });
    // },
    ...mapMutations(["zen", "zens", "zenss"]),
  },
  computed: {
    ...mapState(["money", "car"]),
  },
};
</script>

<style>
button {
  padding: 5px;
  line-height: 30px;
  margin-left: 10px;
}
</style>
